package com.wyy.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * @program: gytcb
 * @author: 吴磊
 * @create: 2021-06-05 13:48
 */
@Repository
public interface ArticleMapper {
    /**
     * 增加文章的评论数
     *
     * @param articleId
     * @return
     */
    @Update("update articles set article_comment_count = article_comment_count + 1 where article_id = #{articleId}")
    Integer incrArticleCommentCount(@Param("articleId") String articleId);

    /**
     * 减少文章的评论数
     *
     * @param articleId
     * @return
     */
    @Update("update articles set article_comment_count = article_comment_count - 1 where article_id = #{articleId}")
    Integer decrArticleCommentCount(@Param("articleId") String articleId);
}
